package com.epam.tcs.dao.hibernate.entities;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "tcs_lecture_status")
public class LectureStatus  implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -107289109525101274L;
	private Long student_lecture_status;
	private String description;

	private List<JournalLectureStatus> journalLectureStatuses;

	public LectureStatus() {
	}

	public LectureStatus(String description,
			List<JournalLectureStatus> journalLectureStatuses) {
		this.description = description;
		this.journalLectureStatuses = journalLectureStatuses;
	}

	@Id
	@Column(name = "student_lecture_status")
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getStudent_lecture_status() {
		return student_lecture_status;
	}

	public void setStudent_lecture_status(Long student_lecture_status) {
		this.student_lecture_status = student_lecture_status;
	}

	@Column(name = "description", length = 20)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
//	@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "lectureStatus")
	@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "lectureStatus")
	public List<JournalLectureStatus> getJournalLectureStatuses() {
		return journalLectureStatuses;
	}

	public void setJournalLectureStatuses(
			List<JournalLectureStatus> journalLectureStatuses) {
		this.journalLectureStatuses = journalLectureStatuses;
	}
}
